<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML LANG="EN">
<HEAD>
<TITLE>VT100.net: Digital VT220 Programmer Reference Manual</TITLE>
<LINK HREF="vt220-rm.css" TYPE="text/css" REL="STYLESHEET">
</HEAD>
<BODY>
<DIV CLASS="navbar"><A HREF="http://vt100.net/"><IMG CLASS="button" SRC="vt100.net-logo.png" ALT="VT100.net" HEIGHT="16" WIDTH="102"></A> VT220 Programmer Reference Manual<TABLE WIDTH="100%">
<COL SPAN="3" WIDTH="33%">
<TBODY>
<TR>
<TD ALIGN="LEFT"><A HREF="chapter2.html">Chapter 2</A></TD>
<TD ALIGN="CENTER"><A HREF="contents.html">Contents</A></TD>
<TD ALIGN="RIGHT"><A HREF="chapter4.html">Chapter 4</A></TD>
</TR>
</TBODY>
</TABLE>
<HR></DIV>
<H1 ID="S3">3 Transmitted Codes</H1>
<H2 ID="S3.1">3.1 General</H2>
<P>This chapter describes the codes that the terminal sends to a
program. The chapter assumes that you are familiar with the
character encoding concepts described in <A HREF="chapter2.html">Chapter 2</A>.</P>
<P>Key codes generated in VT52 mode are listed if they differ from
those generated in the ANSI-compatible (VT200 and VT100) modes.</P>
<P>The terminal can use 15 different national keyboards. This chapter
describes significant differences among the keyboards.</P>
<H2 ID="S3.2">3.2 Keyboard Codes</H2>
<P>The terminal keyboard (<A HREF="figure3-1.html">Figure 3-1</A>) consists of a main keypad, an
editing keypad, an auxiliary keypad, and the top-row function
keys.</P>
<H3 ID="S3.2.1">3.2.1 Main Keypad</H3>
<P>The main keypad consists of standard keys (used to generate
letters, numbers, and symbols) and function keys (used to generate
special function codes).</P>
<H4 ID="S3.2.1.1">3.2.1.1 Standard Keys</H4>
<P>The standard keys generate alphanumeric
characters, either singly or in combination with other keys.</P>
<P>On the North American keyboard, the standard keys show only ASCII
characters and generate only ASCII codes. There are no DEC
supplemental characters among the standard keys. This is a special
case, since most keyboards have some standard keys that generate
DEC supplemental characters as well as ASCII characters.</P>
<P>The standard-key patterns vary among keyboards. Some graphic
characters (either special symbols or characters with diacritical
marks) may or may not be available as standard keys on particular
keyboards. However, you can create any DEC multinational graphic
character that is not available on a standard key, by typing a
valid compose sequence.</P>
<P>Regardless of which keyboard you use and how you create a graphic
character, each character is represented by a unique code. The
code is based on the character's position in the code table. You
can use all GL characters in both 7-bit (VT52 mode, VT100 mode, or
7-bit host line) and 8-bit (VT200 mode, 8-bit host line)
environments. You can only use GR characters in an 8-bit
environment.</P>
<P>All keyboards (except the North American Keyboard) have one or
more standard keys that send different graphic characters (and
corresponding codes). The graphic character sent depends on
whether you selected "Typewriter Keys" or "Data Processing Keys"
in the Keyboard Set-Up screen. (See <A HREF="figure3-2.html">Figure 3-2</A> for an example).</P>
<P>All keys affected by "Typewriter Keys" or "Data Processing Keys"
have more than two characters shown on their keycaps. The key
sends the character on the right side of the keycap when you
select "Data Processing Keys", and the character on the left side
of the keycap when you select "Typewriter Keys". You can select
either shifted (upper) or unshifted (lower) character codes for these
keys in the same way as for other nonalphabetic keys.</P>
<H4 ID="S3.2.1.2">3.2.1.2 Function Keys</H4>
<P>This section describes the main keypad
function keys. The column/row notation used in the descriptions
refers to <A HREF="table2-1.html">Table 2-1</A>.</P>
<TABLE WIDTH="100%">
<THEAD>
<TR>
<TH ALIGN="LEFT">Key</TH>
<TH ALIGN="LEFT">Function</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>&lt;X]</TD>
<TD>The &lt;X] (Delete) key sends a DEL character (7/15).</TD>
</TR>
<TR VALIGN="TOP">
<TD>Tab</TD>
<TD>The <B CLASS="keyname">Tab</B> key sends an HT character (0/9).</TD>
</TR>
<TR VALIGN="TOP">
<TD>Return</TD>
<TD>The <B CLASS="keyname">Return</B> key sends either a CR character
(0/13) or a CR character (0/13) and an LF
character (0/10), depending on the set/reset
state of line feed/new line mode (LNM). (See
<A HREF="chapter4.html">Chapter 4</A>).</TD>
</TR>
<TR VALIGN="TOP">
<TD>Ctrl</TD>
<TD>The <B CLASS="keyname">Ctrl</B> key alone does not send a code.
It is always used in combination with another
key to send a control code.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Lock</TD>
<TD>The <B CLASS="keyname">Lock</B> key alone does not send a code.
It is used in combination with the "Caps Lock"
and "Shift Lock" field selected in the
Keyboard Set-Up screen. <B CLASS="keyname">Lock</B> sets or clears
the "Caps Lock" (or "Shift Lock") state.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Shift<BR>(2 keys)</TD>
<TD>The <B CLASS="keyname">Shift</B> key alone does not send a code.
It is used in combination with other standard
keys to generate uppercase characters. <B CLASS="keyname">Shift</B> is
also used in combination with nonalphabetic
keys to send the top character shown on those
keys.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Space bar</TD>
<TD>The space bar sends an SP character (2/0).</TD>
</TR>
<TR VALIGN="TOP">
<TD>Compose Character</TD>
<TD>The <B CLASS="keyname">Compose Character</B> key does not send a
code. Pressing <B CLASS="keyname">Compose Character</B> starts a
compose sequence, which is used to create
characters that cannot be typed directly from
the keyboard.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S3.2.2">3.2.2 Editing Keypad</H3>
<P>The editing keypad includes editing keys and cursor control keys.
<A HREF="table3-1.html">Table 3-1</A> defines the codes generated by the editing keys, and <A HREF="table3-2.html">Table
3-2</A> defines the codes sent by the cursor control keys.</P>
<H3 ID="S3.2.3">3.2.3 Auxiliary Keypad</H3>
<P>The characters sent by the auxiliary keypad keys depend on the
setting of two features, the operating mode (ANSI or VT52) and the
keypad (application or numeric) features. The application keypad
feature is usually selected only by the computer, but can be
selected in the General Set-Up screen. See <A HREF="chapter4.html">Chapter 4</A> for more
information about keypad character selection.</P>
<P><A HREF="table3-3.html">Table 3-3</A> lists the character codes generated by the auxiliary
keypad in ANSI (VT100, VT200) mode and in VT52 mode.</P>
<H3 ID="S3.2.4">3.2.4 Top-Row Function Keys</H3>
<P>There are 20 top-row function keys, F1 through F20. The first five
keys (F1 through F5) labeled <B CLASS="keyname">Hold Screen</B>, <B CLASS="keyname">Print Screen</B>, <B CLASS="keyname">Set-Up</B>,
<B CLASS="keyname">Data/Talk</B>, and <B CLASS="keyname">Break</B>, do not send codes; they are local function
keys. Keys <B CLASS="keyname">F6</B> through <B CLASS="keyname">F20</B> send the codes defined in <A HREF="table3-4.html">Table 3-4</A>.</P>
<H3 ID="S3.2.5">3.2.5 Control Codes</H3>
<P><A HREF="table3-5.html">Table 3-5</A> lists the keys and key combinations used to send control
codes. These keys and combinations are valid on all keyboards.
The control codes are C0 7-bit control characters; there is no
similar mechanism for sending C1 8-bit control characters.</P>
<H2 ID="S3.3">3.3 Enabling and Disabling Auto Repeat</H2>
<P>You can enable and disable the auto repeat feature from the
keyboard, using the Keyboard Set-Up screen or the DECARM escape
sequence (<A HREF="chapter4.html">Chapter 4</A>). If the terminal receives the DECARM sequence
to turn auto repeat off while an auto repeat is in progress, the
key stops auto repeating. If the terminal receives the escape
sequence to turn auto repeat on while a key that has been auto
repeating is still held down, the key immediately auto repeats.
Keys which can auto repeat usually start auto repeating after a
delay of 0.5 seconds.</P>
<P>The auto repeat speed is a function of the host transmit speed.
This gives a constant repeat rate at all transmit speeds. At
speeds of 2400 baud or above, all keys auto repeat at 30
keystrokes per second. For the purpose of the auto repeat
feature, the keyboard is divided into the following three groups.</P>
<PRE>    Group A  Main typing array
    Group B  Cursor keys and keypad keys
    Group C  Top-row function keys and editing keys</PRE>
<P>Every key in each group auto repeats at the fixed rate set by the
transmit speed, regardless of how many codes the key actually
sends.</P>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH ROWSPAN="2" ALIGN="LEFT">Host Transmit Speed (Baud)</TH>
<TH COLSPAN="3">Auto Repeat Rate (Keys/Sec)</TH>
</TR>
<TR VALIGN="BOTTOM">
<TH ALIGN="LEFT">Group A</TH>
<TH ALIGN="LEFT">Group B</TH>
<TH ALIGN="LEFT">Group C</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>&gt;=2400</TD>
<TD>30</TD>
<TD>30</TD>
<TD>30</TD>
</TR>
<TR>
<TD>1200</TD>
<TD>30</TD>
<TD>30</TD>
<TD>24</TD>
</TR>
<TR>
<TD>600</TD>
<TD>30</TD>
<TD>20</TD>
<TD>12</TD>
</TR>
<TR>
<TD>300</TD>
<TD>30</TD>
<TD>12</TD>
<TD>12</TD>
</TR>
<TR>
<TD>150</TD>
<TD>6</TD>
<TD>6</TD>
<TD>6</TD>
</TR>
<TR>
<TD>110</TD>
<TD>6</TD>
<TD>6</TD>
<TD>6</TD>
</TR>
<TR>
<TD>75</TD>
<TD>6</TD>
<TD>6</TD>
<TD>6</TD>
</TR>
</TBODY>
</TABLE>
<P>In general, the "Transmit Rate Limit" feature (in the
Communications Set-Up screen) does not affect auto repeat rates,
since all 5 codes can be sent at the limited speed of 150
characters per second at most baud rates. In local mode, keys will
auto repeat at 30 keystrokes per second.</P>
<P>The following keys do not auto repeat: <B CLASS="keyname">Hold Screen</B>, <B CLASS="keyname">Print Screen</B>,
<B CLASS="keyname">Set-Up</B>, <B CLASS="keyname">Data/Talk</B>, <B CLASS="keyname">Break</B>, <B CLASS="keyname">Compose Character</B>, <B CLASS="keyname">Shift</B>, <B CLASS="keyname">Return</B>, <B CLASS="keyname">Lock</B>,
and <B CLASS="keyname">Ctrl</B>. Shifted or controlled keys will auto repeat.</P>
<H2 ID="S3.4">3.4 Keyboard Lock and Unlock</H2>
<P>The following conditions may cause the keyboard to lock.</P>
<UL>
<LI>If the program sends a command to set the keyboard action
mode (KAM) as described in <A HREF="chapter4.html">Chapter 4</A></LI>
<LI>If the keyboard output buffer is full</LI>
</UL>
<P>When the keyboard is locked, all keyboard keys except <B CLASS="keyname">Hold Screen</B>,
<B CLASS="keyname">Print Screen</B>, <B CLASS="keyname">Set-Up</B>, <B CLASS="keyname">Data/Talk</B>, and <B CLASS="keyname">Break</B> are disabled, and the
keyboard Wait indicator turns on.</P>
<P>If the keyboard is locked, any of the following events can unlock
it.</P>
<UL>
<LI>The output buffer becomes less than full (assuming KAM,
keyboard action mode, is not set).</LI>
<LI>A KAM reset sequence is received when the output buffer
is not full (<A HREF="chapter4.html">Chapter 4</A>). Also the DECSTR sequence, and
set-up "Reset Terminal" field reset KAM.</LI>
<LI>You select "Clear Comm", "Reset Terminal", "Recall", or
"Default" fields in set-up. (Entering set-up unlocks the
keyboard while the terminal is in set-up. If you do not
select these functions in set-up, the keyboard locks
again when you exit set-up).</LI>
<LI>The terminal performs the power-up self-test (DECTST) or
a hard reset (RIS).</LI>
</UL>
<DIV CLASS="navbar"><HR>
<TABLE WIDTH="100%">
<COL SPAN="3" WIDTH="33%">
<TBODY>
<TR>
<TD ALIGN="LEFT"><A HREF="chapter2.html">Chapter 2</A></TD>
<TD ALIGN="CENTER"><A HREF="contents.html">Contents</A></TD>
<TD ALIGN="RIGHT"><A HREF="chapter4.html">Chapter 4</A></TD>
</TR>
</TBODY>
</TABLE>
<DIV CLASS="navbot">http://vt100.net/docs/vt220-rm/chapter3.html</DIV></DIV>
</BODY>
</HTML>
